import { MessageType, Message } from "mirai-ts"
import commonUtils from "@/utils/commonUtils"
export default {
  // 彩蛋对话
  eggTalk:(msg: MessageType.GroupMessage) => {
    const msgStr = msg.plain.trim()
    if(["氪？","氪?","氪吗"].indexOf(msgStr)>-1){
      const resList = [
        '氪爆！',
        '648！ 冲',
        '要不钱给我 我给你抽箱子'
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = []
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["晚安","睡觉了"].indexOf(msgStr)>-1){
      const resList = [
        '快来我被窝！床已经暖好了',
        '来开船啊 睡什么睡',
        '晚安'
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = []
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["tql"].indexOf(msgStr)>-1){
      const resList = [
        'tql 恐怖巨佬',
        '神巨！',
        '大佬！'
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = []
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["help 查询指令使用方式"].indexOf(msgStr)>-1){
      const resList = [
        '给yuyuko整蒙了',
        '好好看yuyuko说明啊喂'
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = []
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["上班","干活"].indexOf(msgStr)>-1){
      const resList = [
        '做工？做咩啊！饮茶先啊！',
        '打工人加油！',
        '啊 我不想干活了，什么时候能停电啊',
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = []
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["离谱","就很离谱","神奇","就很神奇","扯淡","鬼扯","瞎扯"].indexOf(msgStr)>-1){
      const resList = [
        '确实（指赞同）',
        '雀食'
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = []
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["不要小看色图啊混蛋！","不要小看色图啊混蛋"].indexOf(msgStr)>-1){
      const resList = [
        '那你自己发瑟图啊混蛋！',
        '瑟图是第一生产力！'
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = []
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["有没有车车","ymycc"].indexOf(msgStr)>-1){
      let messageChain: MessageType.MessageChain = []
      messageChain.push(Message.Image(null, null,"./diaoImg/gugugu.gif"))
      return messageChain
    }
    if(["今晚cw?","今晚cw？","今晚工会战","来cw"].indexOf(msgStr)>-1){
      const resList = [
        '从人群中钻出一个bot "我来！！！！',
        '我也想要钢',
        '能不呢个分我点钢',
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = []
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["偶哈有","偶哈呦","早","早上好"].indexOf(msgStr)>-1){
      const resList = [
        '你醒啦？群友已经被我控制了',
        '早啊',
        '偶哈哟',
        '啊啊啊啊  我想睡觉 帮我把插头拔一下',
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = []
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }

    if(msgStr.indexOf("欧拉欧拉")>-1){
      const resList = [
        '木大木大木大木大木大木大',
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = []
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(msgStr.indexOf("卡其脱离太")>-1){
      const resList = [
        '木那木那一',
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = []
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(msgStr.indexOf("@憨批bot")>-1){
      const resList = [
        '不要复制@啊',
        '复制@没用滴',
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = []
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(msgStr.indexOf("抽卡真快乐")>-1){
      const resList = [
        '人类本质 开箱机器',
        '赌狗！',
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = []
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }

    return false
  },

  //@对话
  atTalk:(msg: MessageType.GroupMessage) => {
    const msgStr = msg.plain.trim()

    if(["小bot你怎么回事"].indexOf(msgStr)>-1){
      const resList = [
        '斯密马赛 斯密马赛',
        '我也不敢说 我也不敢问',
        '有本事来拔我电源',
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["捧场"].indexOf(msgStr)>-1){
      const resList = [
        '卧槽 牛批 666',
        '大佬太强了 rbq rbq',
        '神巨的光芒如此刺眼',
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["给我康康","给我看看","让我康康","让我看看","看看里面","看看老婆"].indexOf(msgStr)>-1){
      const resList = [
        'https://gitee.com/missile_xuan/mgaia-mirai-ts-open'
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
      messageChain.push(Message.Plain('我好看吗？'))
      messageChain.push(Message.Image(null, null,"./憨批物料/压缩/中国3.jpg"))
      messageChain.push(Message.Plain('\n看看里面？'))
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["prpr","摸摸","贴贴"].indexOf(msgStr)>-1){
      const resList = [
        '贴贴！',
        '走开 有点热',
        '你挡住我风扇了',
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["nmsl","傻逼"].indexOf(msgStr)>-1){
      const resList = [
        '我给你一主板哦！',
        '正在检查黑名单容量',
        '¿',
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["弱智","five"].indexOf(msgStr)>-1){
      const resList = [
        '键盘给你 你来写',
        '哇 那你来贡献代码',
        '呜呜呜呜呜',
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["炼铜"].indexOf(msgStr)>-1){
      const resList = [
        '已为您接通110 正在传输地址',
        '建议注射针对铜的靶向药物',
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["我爱你","爱你"].indexOf(msgStr)>-1){
      const resList = [
        '我心里只有yuyuko',
        '真的吗 我不信',
        '那去给我交电费吧',
        '电压不稳了  让我缓缓',
        '--...-....-...-/-..---..-.-----/---..-...--...-/-..----.--.....'
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["涩图","瑟图","色图","图","每日一图","来点瑟图","来点色图"].indexOf(msgStr)>-1){
      const resList = [
        '找你群友要啊,关憨批什么事',
        '可拉倒吧 南山必胜客在等着gank呢',
        '小bot还想多活几天',
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["说骚话"].indexOf(msgStr)>-1){
      const resList = [
        'emmmmmm 汪~',
        '骚话',
        '#$%^$&^%&%^@#$@!@#',
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["做我老婆","结婚","我们结婚"].indexOf(msgStr)>-1){
      const resList = [
        '桃饱网大会员?',
        '你是个好人',
        '这个嘛 我考虑一下',
        '噫  是碳基生物',
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["抽个富婆"].indexOf(msgStr)>-1){
      const resList = [
        '富婆？我也要！',
        'emmm 富婆抽你差不多',
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["誓约"].indexOf(msgStr)>-1){
      const resList = [
        'yuyuko是我老婆 你没机会了?',
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["114514"].indexOf(msgStr)>-1){
      const resList = [
        '哼哼啊啊啊啊啊啊啊啊啊啊',
        '味有点大',
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["?","？"].indexOf(msgStr)>-1){
      const resList = [
        '¿',
        '?',
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = []
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["抽个老公"].indexOf(msgStr)>-1){
      const resList = [
        '这是我没想到的',
        '你考虑下群友？'
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["有趣","好棒"].indexOf(msgStr)>-1){
      const resList = [
        '嗨呀!  脸红了',
        '电压有点高',
        '开心到超频',
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["戳"].indexOf(msgStr)>-1){
      const resList = [
        '怎么了，有什么话想说吗？',
        '艹 好痒',
        '哒咩',
        '哇 溜了溜了',
        '[图]'
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
      if(resList[index] === '[图]'){
        messageChain.push(Message.Plain('我一棍子捅死你'))
        messageChain.push(Message.Image(null, null,"./憨批物料/压缩/一棍子捅死你.jpg"))
      }else{
        messageChain.push(Message.Plain(resList[index]))
      }
      
      return messageChain
    }

    if(["摸头","摸摸","摸"].indexOf(msgStr)>-1){
      const resList = [
        '？？？？',
        '我一米七啊 兄弟',
        '啊~你在摸哪里啊！',
        '我™'
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["老婆"].indexOf(msgStr)>-1){
      const resList = [
        '呵，你是不是见谁都叫老婆',
        '我是你的第几张纸片人？',
        '阿巴阿巴',
        '醒醒啊！（扇巴掌）',
        '-..............-/-.-...-.--.--..'
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["驯服干员"].indexOf(msgStr)>-1){
      const resList = [
        '你不对劲啊  非常不对劲',
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["十连干员","十连干员寻访","十连","十连抽个老婆","十连老婆"].indexOf(msgStr)>-1){
      const resList = [
        '这样太刷屏了 算了吧',
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["来开船","开船?"].indexOf(msgStr)>-1){
      const resList = [
        '窝窝屎 憨批都不玩',
        '电压太高 告辞',
        '恩？脚本上线不怕毛子封号吗？',
        '带不动带不动'
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["晚上吃啥","今晚吃啥","中午吃啥","午餐吃啥"].indexOf(msgStr)>-1){
      const resList = [
        'emmm 减肥',
        '红烧拿拿酱',
        '兴登堡',
        '柯尼斯堡',
        '秘制小汉堡',
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["你什么时候能通过图灵测试","你什么时候能过图灵测试"].indexOf(msgStr)>-1){
      const resList = [
        '抓个倪哥塞机箱的时候',
        '你要不来机箱当语言处理单元？',
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["我有个大胆的想法"].indexOf(msgStr)>-1){
      const resList = [
        '想被我按机箱里口算比特币？',
        '我国有一套完整的刑法',
        '我机箱挺宽敞的'
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["我喜欢你"].indexOf(msgStr)>-1){
      const resList = [
        '嗯 站后面排下队',
        '电压平稳~',
        '咳 有点跳ping',
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    if(["和我做爱吧",'透我','给我透'].indexOf(msgStr)>-1){
      const resList = [
        '¿',
        '请先和你的机箱练习一下',
        '你问题很大啊 兄弟',
      ]
      let index = commonUtils.randomNum(0,resList.length-1)
      let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
      messageChain.push(Message.Plain(resList[index]))
      return messageChain
    }
    
    
    return false
  },
  // 多样对话
  vipTalk:function(msg: MessageType.GroupMessage,vipGroupList:number[]){
    // 存在vip群中
    // if(!vipGroupList.includes(msg.sender.group.id)){
    //   return false  
    // }

    if(msg.isAt()){
      const msgStr = msg.plain.trim()
      if(["反馈bug"].indexOf(msgStr)>-1){
        const resList = [
          '扫码反馈哦'
        ]
        let index = commonUtils.randomNum(0,resList.length-1)
        let messageChain: MessageType.MessageChain = [Message.At(msg.sender.id)]
        messageChain.push(Message.Plain(resList[index]))
        messageChain.push(Message.Image(null, null,"./憨批物料/扫码/扫码拼合.png"))
        messageChain.push(Message.Plain("\n 反馈群 1050053532"))
        return messageChain
      }
      
    }
    return false
    
  },
}